<script setup lang="ts">
import { ref } from "vue";
    const isActive= ref(false)
</script>
<template>
    <div id="app">
        <!-- 类的动态绑定-特殊写法 -->
        <div class="box2" :class="{box1:isActive}"></div>
    </div>
  
</template>
<style>
    .box1{
        width: 100px;
        height: 100px;
        background-color: #dba014;
        border-radius: 50%;
    }
    .box2{
         width: 100px;
        height: 100px;
        background-color: #db1421;
    }
</style>

